package com.liang.maogouyuyin.utils.lzy

import android.app.Activity
import android.graphics.drawable.Drawable
import android.widget.RadioButton
import androidx.core.content.res.ResourcesCompat

object ExpandUtil {

    /**
     *
     *
     * @param myActivity
     * @param drawableId
     * @param width
     * @param length
     */
    fun RadioButton.setDrawableForRadioButton(myActivity: Activity, drawableId:Int, width:Int, length:Int){
        val drawable: Drawable?= ResourcesCompat.getDrawable(resources,drawableId,null)
        drawable?.setBounds(0,0,
            ScreenUtils.dip2px(width, myActivity),
            ScreenUtils.dip2px(length, myActivity)
        )
        this.setCompoundDrawables(null,drawable,null,null)
    }
}